#include "httpstuff.h"
#include <stdio.h>
#include <string.h>

void test1 () {
	HTTPMsg *msg1 = new_HTTPMsg();
      	msg1->resource = strdup ("https://cse3530p1.googlecode.com/svn/text.txt");
	char *a = HTTPMsg_findFilePath(msg1);
	printf("Returned <%s>\n\n", a);

}

void test2() {

	HTTPMsg *msg3 = new_HTTPMsg();
	if (!msg3) return;
	msg3->resource = strdup ("/svn/text.txt");
	char *c = HTTPMsg_findFilePath(msg3);
	printf("Returned <%s>\n\n", c);

}

void test3() {

	HTTPMsg *msg3 = new_HTTPMsg();
	if (!msg3) return;
	msg3->resource = strdup ("svn/text.txt");
	char *c = HTTPMsg_findFilePath(msg3);
	printf("Returned <%s>\n\n", c);

}

void test4 () {

	HTTPMsg *msg2 = new_HTTPMsg();
	msg2->resource = strdup ("www.cse3530p1.googlecode.com/svn/text.txt");
	char *b = HTTPMsg_findFilePath(msg2);
	printf("Returned <%s>\n\n", b);

}
int main () {
  test1();
  test2();
  test3();
  test4();
  return 0;
}

